package com.jijs.jws.client;

import java.net.MalformedURLException;
import java.net.URL;

import javax.xml.namespace.QName;

class HelloClient {
	public static void main(String args[]) throws MalformedURLException {
		// 默认访问
		test1();
		// 通过构造访问
		test2();
	}

	public static void test1() throws MalformedURLException {
		HelloService service = new HelloService();
		IHello helloProxy = service.getHelloPort();
		String hello = helloProxy.sayHello("你好");
		System.out.println(hello);
	}

	public static void test2() throws MalformedURLException {
		URL url = new URL("http://localhost:8080/hello?wsdl");
		QName qname = new QName("http://jws.jijs.com/", "HelloService");

		HelloService service = new HelloService(url, qname);
		IHello helloProxy = service.getHelloPort();
		String hello = helloProxy.sayHello("你好");
		System.out.println(hello);
	}
}